package com.zengguang.testkaoshi.services.impl;

import com.zengguang.testkaoshi.dao.PersoninfoDao;
import com.zengguang.testkaoshi.pojo.Personinfo;
import com.zengguang.testkaoshi.services.IPersoninfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PersoninfoService implements IPersoninfoService {
    @Autowired
    private PersoninfoDao personinfoDao;
    //查询全部
    @Override
    public List<Personinfo> selectAllPersoniinfo() {
        List<Personinfo> list=personinfoDao.selectAllPersoniinfo();
        return list;
    }
    //插入人员信息
    @Override
    public int insertPersoninfo(Personinfo personinfo) {
        int returnInt=0;
        int insertInt=personinfoDao.insertPersoninfo(personinfo);
        returnInt=insertInt;
        return returnInt;
    }
    //删除人员信息
    @Override
    public int deletePersoninfo(int personinfoid) {
        int returnInt=0;
        int delInt=personinfoDao.deletePersoninfo(personinfoid);
        returnInt=delInt;
        return returnInt;
    }
    //更新人员信息
    @Override
    public int updatePersoninfo(Personinfo personinfo) {
        int returnInt=0;
        int updInt=personinfoDao.updatePersoninfo(personinfo);
        returnInt=updInt;
        return returnInt;
    }

    @Override
    public List<Personinfo> selectByIDandPwd(String loginid, String pwd) {
        List<Personinfo> list=personinfoDao.selectByIDandPwd(loginid,pwd);
        return list;
    }
}
